﻿/*
 * Created by SharpDevelop.
 * User: bcrawford
 * Date: 5/20/2014
 * Time: 2:45 PM
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */
using System;

namespace RfiCoder.Utilities
{
  /// <summary>
  /// Description of Configuration.
  /// </summary>
  public sealed class Configuration
  {
    private static Configuration instance = new Configuration();
    
    private ConfigLibrary.ConfigHandler configHandler;
    
    public static Configuration InstanceOf {
      get {
        return instance;
      }
    }
    
    private Configuration()
    {
      configHandler = new ConfigLibrary.ConfigHandler(@".\\config.json");

    }
    
    public string DatabaseConnectionParameters
    {
      get { return String.Format(
        "Server={0}; Database={1}; Port={2}; User Id={3}; Pwd={4};",
        this.configHandler.SqlHost,
        this.configHandler.SqlDatabase,
        this.configHandler.SqlPort,
        this.configHandler.SqlUser,
        this.configHandler.SqlPass
       );; }
    }
    
    public string Version
    {
      get { return this.configHandler.Version; }
      set { this.configHandler.Version = value; }
    }
    
    public string ConfigFilePath {
      get { return this.configHandler.ConfigFilePath; }
      set { this.configHandler.ConfigFilePath = value; }
    }

    public string MailHost
    {
      get { return  this.configHandler.MailHost; }
    }
    
    public string MailUser
    { 
      get { return  this.configHandler.MailUser; }
    }

    public string MailPass
    { 
      get { return  this.configHandler.MailPass; }
    }

    public int MailPort
    { 
      get { return  this.configHandler.MailPort; }
    }

    public System.Collections.Generic.Dictionary< string, string > Addresses
    {
      get { return this.configHandler.Addresses; }
    }
  }
}
